<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h3>模板替代</h3>
      <child inline-template>
        <div>这是child组件 - {{ count }}</div>
      </child>
      <child2></child2>
    </div>

    <script src="../../Vue.js"></script>
    <script type="text/x-template" id="child2">
      <div>这是child2组件</div>
    </script>
    <script>
      const Child = {
        data() {
          return {
            count: 10,
          };
        },
      };
      const Child2 = {
        template: "#child2",
      };

      new Vue({
        el: "#app",
        data: {},
        components: {
          Child,
          Child2,
        },
      });
    </script>
  </body>
</html>
